local fuju = fk.CreateSkill{
  name = "#rfenghou_3d9j__fujuactive",
}

fuju:addEffect("active", {
  interaction = function(self, player)
    local choices = {}
    choices[1] = Fk:translate("drawX"):gsub("{num}", self.num)
    choices[2] = Fk:translate("discardX"):gsub("{num}", self.num)
    return UI.ComboBox { choices = choices }
  end,
  prompt = function(self, player, selected_targets)
    if self.interaction.data then
      if self.interaction.data:startsWith(Fk:translate("drawX"):sub(1, 1)) then
        return "#rfenghou_3d9j__fujudamage-kill:::" .. self.interaction.data
      else
        return "#rfenghou_3d9j__fujudamage-killed:::" .. self.interaction.data
      end
    end
    return "#rfenghou_3d9j__fujudamage-invoke"
  end,
  card_num = 0,
  target_num = 1,
  card_filter = Util.FalseFunc,
  target_filter = function(self, player, to_select, selected, _, _, extra_data)
    if self.interaction.data then
      if self.interaction.data:startsWith(Fk:translate("drawX"):sub(1, 1)) then
        return true
      else
        return #to_select:getCardIds("he") >= extra_data.num
      end
    end
  end,
})

Fk:loadTranslationTable{
  ["#rfenghou_3d9j__fujuactive"] = "复炬",

  ["#rfenghou_3d9j__fujudamage-invoke"] = "复炬：你可以令一名角色摸或弃置牌，你可能会失去〖复炬〗",
  ["#rfenghou_3d9j__fujudamage-kill"] = "复炬：你可以令一名角色%arg，你可能会失去〖复炬〗直到其杀死角色",
  ["#rfenghou_3d9j__fujudamage-killed"] = "复炬：你可以令一名角色%arg，你可能会失去〖复炬〗直到其死亡",
}

return fuju
